# The Flutter tooling requires that developers have CMake 3.10 or later
# installed. You should not increase this version, as doing so will cause
# the plugin to fail to compile for some customers of the plugin.
cmake_minimum_required(VERSION 3.10)

project(flutter_qt_7ze_library VERSION 0.0.1 )

# 设置C++标准
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

file(GLOB SRC_FILES ${PROJECT_SOURCE_DIR}/C/*.c)

IF(ANDROID)
  file(GLOB SRC_FILES2 ${PROJECT_SOURCE_DIR}/android/*.c)
  include_directories(${PROJECT_SOURCE_DIR}/android)
endif(ANDROID)

include_directories(${PROJECT_SOURCE_DIR}/C)


add_library(flutter_qt_7ze SHARED
  ${SRC_FILES} ${SRC_FILES2}  "flutter_qt_7ze.cpp"
)

find_library(flutter_qt_7ze android )

IF(ANDROID)
  target_link_libraries(flutter_qt_7ze android)
endif(ANDROID)

set_target_properties(flutter_qt_7ze PROPERTIES
  PUBLIC_HEADER flutter_qt_7ze.h
  OUTPUT_NAME "flutter_qt_7ze"
)

IF(IOS)
  set_target_properties(flutter_qt_7ze  PROPERTIES
    FRAMEWORK TRUE
    FRAMEWORK_VERSION A
    MACOSX_FRAMEWORK_IDENTIFIER com.seantone.flutter_qt_7ze 
    VERSION 1.0.0
    SOVERSION 1.0.0
    PUBLIC_HEADER "${HEADER_FILES}"
    XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET 13.0
    XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT "dwarf-with-dsym"
  )
ELSE(IOS)
  target_compile_definitions(flutter_qt_7ze PUBLIC DART_SHARED_LIB)
ENDIF(IOS)

